<!DOCTYPE html>
<html lang="cn">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./node_modules/vue/dist/vue.js"></script>
</head>
<body>
    <div id="app">
        {{message}}
        <input type="text" v-model="message">
    </div>
    <script>
        //1.创建Vue实例
        const vm = new Vue({
            el:"#app",
            data:{
                message:""
            },
            watch: {
                message(oldValue,newValue){
                    console.log(oldValue,newValue)
                }
            }
        })

    </script>
</body>
</html>